import { _decorator, Component, Label } from "cc";
import { ILanguage, LanguageMgr } from "./LanguageMgr";
const { ccclass, property } = _decorator;
@ccclass('LanguageLabel')
export default class LanguageLabel extends Component implements ILanguage {
    @property
    languageKey: string = '';
    @property(Label)
    label:Label;
    protected start(): void {
        LanguageMgr.instance.addILanguage(this);
        this.refreshLanguage();
    }
    refreshLanguage() {
        this.label.string = LanguageMgr.instance.getString(this.languageKey);
    }
    protected onDestroy(): void {
        LanguageMgr.instance.removeILanguage(this);
    }
}